home *** CD-ROM | disk | FTP | other *** search
/ Holt Researcher: American History / Holt Researcher: American History.iso / pc / modules / dbmap.dxr / 00019_scroll button.ls < prev    next >
Encoding:
Text File  |  2000-01-27  |  1.3 KB  |  52 lines

  1. property ancestor, pSlider, pIsIncreasing
  2.  
  3. on new me, buttonName, castName, theChannel, theStageLoc, Slider, isIncreasing, descendant
  4.   if objectp(descendant) then
  5.     ancestor = new(script("generic Button"), buttonName, castName, theChannel, theStageLoc, descendant)
  6.   else
  7.     ancestor = new(script("generic Button"), buttonName, castName, theChannel, theStageLoc, me)
  8.   end if
  9.   pSlider = Slider
  10.   pIsIncreasing = isIncreasing
  11.   return me
  12. end
  13.  
  14. on trackMouse me
  15.   if not me.pIsDisabled then
  16.     LastAction = 1
  17.     repeat while the mouseDown
  18.       State = the memberNum of sprite me.pChannel
  19.       if rollOver(me.pChannel) then
  20.         set the member of sprite the pChannel of me to me.pDownState
  21.         performFunction(me._me)
  22.       else
  23.         set the member of sprite the pChannel of me to me.pUpState
  24.       end if
  25.       updateStage()
  26.       LastAction = 0
  27.     end repeat
  28.     if rollOver(me.pChannel) then
  29.       set the member of sprite the pChannel of me to me.pUpState
  30.       if LastAction then
  31.         performFunction(me._me)
  32.       end if
  33.     end if
  34.     updateStage()
  35.   end if
  36.   return me
  37. end
  38.  
  39. on performFunction me
  40.   setting = getSetting(pSlider)
  41.   if pIsIncreasing then
  42.     setThumb(pSlider, setting + 1)
  43.   else
  44.     setThumb(pSlider, setting - 1)
  45.   end if
  46.   return me
  47. end
  48.  
  49. on buttonLoc me
  50.   return me
  51. end
  52.